<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>BlackDream</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <script>
        var arr, reg = new RegExp("(^| )theme=([^;]*)(;|$)");
        if(arr = document.cookie.match(reg)){
            var theme = unescape(arr[2]).split('"')[0];
            document.write('<link type="text/css" rel="stylesheet" href="/client/library/bootstrap/theme/'+ theme + '.min.css"/>')
        }
        else{
            document.write('<link type="text/css" rel="stylesheet" href="/client/library/bootstrap/theme/slate.min.css"/>')
        }
    </script>
    <link rel="shortcut icon" href="/client/framework/logo.jpg" title="BlackDream">
    <link type="text/css" rel="stylesheet" href="/client/framework/framework.css"/>
    <script data-main="/client/framework/main.js" src="/client/library/require/require.min.js"></script>
</head>
<body ng-controller="frameworkController">
    <header id="framework-header" class="navbar navbar-fixed-top navbar-default">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a style="padding: 7px 10px 7px 10px;" class="navbar-brand" location-go="/" href="javascript:void(0);">
                    <img style="margin: 0 10px;height: 100%;display: inline;vertical-align: middle;" src="/client/framework/logo.jpg"/>BlackDream
                </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-collapse">
                <form class="navbar-form navbar-left" role="search" ng-submit="search();">
                    <div class="form-group">
                        <div class="input-group input-group-sm">
                            <input type="text" ng-model="keyword" class="form-control" style="width:250px;" placeholder="他们的生成器">
                            <span class="input-group-btn">
                                <button ng-click="search();" class="btn btn-default" type="button"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
                            </span>
                        </div>
                    </div>
                </form>
                <ul class="nav navbar-nav navbar-left">
                    <li><a href="javascript:void(0)"><strong ng-bind="viewPage.title"></strong></a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                            <span ng-bind="user.userName"></span><span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="javascript:void(0);" location-go="/business/generatorInstance/manage">我的实例</a></li>
                            <li ng-if="user.isDeveloper"><a href="javascript:void(0);" location-go="/business/generator/manage">我的生成器</a></li>
                            <li role="separator" class="divider"></li>
                            <li ng-if="!user.creator"><a href="javascript:void(0);" location-go="/business/user/manage">我的用户</a></li>
                            <li ng-if="!user.creator"><a href="javascript:void(0);" location-go="/statistic">数据统计</a></li>
                            <li ng-if="!user.creator" role="separator" class="divider"></li>
                            <li><a href="javascript:void(0);" ng-click="openUpdatePasswordModal()">修改密码</a></li>
                            <li><a href="javascript:void(0);" ng-click="openSelectThemeModal()">设置主题</a></li>
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">帮助<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="javascript:void(0);" location-go="/guide">用户指南</a></li>
                            <li><a href="javascript:void(0);" ng-click="openTooltipHistoryModal()">系统消息</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="javascript:void(0);" ng-click="openAboutModal()">关于</a></li>
                        </ul>
                    </li>
                    <li><a href="javascript:void(0);" ng-click="openLogoutModal()"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> 退出</a></li>
                </ul>
            </div>
        </div>
    </header>
    <div class="container-fluid" id="framework-main">
        <div class="row" >
            <div class="col-sm-12">
                <div id="framework-page">
                    <div ng-view></div>
                </div>
            </div>
        </div>
    </div>
    <footer id="framework-footer">
        <strong class="text-muted">机械重复性的工作如同黑色梦魇，同一个问题并不应该被解决两次。</strong>
    </footer>
    <!-- 消息条组 -->
    <div id="framework-tooltip" >
        <uib-alert ng-repeat="tooltip in tooltips track by $index" type="{{tooltip.level}}" close="tooltips.splice($index,1)"><span ng-bind="tooltip.message"></span></uib-alert>
    </div>
    <!-- 加载进度 -->
    <div id="framework-loading" ng-show="loadStatus.status.loading"></div>
    <!-- 消息记录 -->
    <script id="framework/tooltip-history.html" type="text/ng-template" >
        <div class="modal-header">
            <h3 class="modal-title">系统消息</h3>
        </div>
        <div class="modal-body">
            <table class="table table-condensed table-hover">
                <thead>
                <tr class="active">
                    <th width="30">#</th><th width="100">级别</th><th width="200">时间</th><th>内容</th>
                </tr>
                </thead>
                <tbody>
                <tr class="{{tooltip.level}}" ng-repeat="tooltip in result.records track by $index">
                    <th>{{$index + 1}}</th><td>{{tooltip.level}}</td><td>{{tooltip.dateTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td><td>{{tooltip.message}}</td>
                </tr>
                </tbody>
            </table>
            <uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="result.total"
                ng-model="pager.page" ng-change="search()" items-per-page="pager.pageSize"
                first-text="首页" previous-text="上页" next-text="下页" last-text="尾页">
            </uib-pagination>
        </div>
        <div class="modal-footer">
            <button class="btn btn-sm btn-primary" ng-click="confirm()">确定</button>
        </div>
    </script>
    <!-- 退出系统 -->
    <script id="framework/logout.html" type="text/ng-template" >
        <div class="modal-header">
            <h3 class="modal-title">退出</h3>
        </div>
        <div class="modal-body">确定退出系统？</div>
        <div class="modal-footer">
            <button class="btn btn-sm btn-warning" type="button" ng-click="cancel()">取消</button>
            <button class="btn btn-sm btn-primary" type="button" ng-click="confirm()">确定</button>
        </div>
    </script>
    <!-- 弹出对话框 -->
    <script id="framework/alert.html" type="text/ng-template" >
        <div class="modal-header">
            <h3 class="modal-title">{{title}}</h3>
        </div>
        <div class="modal-body" ng-bind="message"></div>
        <div class="modal-footer">
            <button class="btn btn-sm btn-primary" type="button" ng-click="confirm()">确定</button>
        </div>
    </script>
    <!-- 确认对话框 -->
    <script id="framework/confirm.html" type="text/ng-template" >
        <div class="modal-header">
            <h3 class="modal-title">{{title}}</h3>
        </div>
        <div class="modal-body" ng-bind="message"></div>
        <div class="modal-footer">
            <button class="btn btn-sm btn-warning" type="button" ng-click="cancel()">取消</button>
            <button class="btn btn-sm btn-primary" type="button" ng-click="confirm()">确定</button>
        </div>
    </script>
    <!-- 选择主题对话框 -->
    <script id="framework/theme.html" type="text/ng-template" >
        <div class="modal-header">
            <h3 class="modal-title">设置主题</h3>
        </div>
        <div class="modal-body">
            <div style="height: 600px;overflow-y: scroll;overflow-x: hidden;">
                <div class="row" ng-repeat="theme in themes">
                    <div class="col-sm-12">
                        <div class="thumbnail" ng-dblclick="selectTheme(theme)">
                            <img width="450" height="270" ng-src="/client/library/bootstrap/theme/{{theme}}.png" alt="{{theme}}">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-sm btn-default" type="button" ng-click="selectTheme('default')">默认主题</button>
            <button class="btn btn-sm btn-primary" type="button" ng-click="cancel()">关闭</button>
        </div>
    </script>
    <!-- 修改密码 -->
    <script id="framework/passwordUpdate.html" type="text/ng-template" >
        <div class="modal-header">
            <h3 class="modal-title">修改密码</h3>
        </div>
        <div class="modal-body">
            <form name="frameworkPasswordUpdateForm" class="form-horizontal" role="form" novalidate>
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="text-danger">原密码</span></label>
                    <div class="col-sm-6">
                        <input name="oldPassword" uib-tooltip="{{getMessage('oldPassword',frameworkPasswordUpdateForm.oldPassword.$error,validateMessages)}}"
                               tooltip-trigger="none" tooltip-is-open="frameworkPasswordUpdateForm.oldPassword.$invalid && frameworkPasswordUpdateForm.oldPassword.$dirty"
                               ng-model="request.oldPassword" type="password" class="form-control input-sm" placeholder="原密码" ng-pattern="/^\w{6,20}$/" required/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="text-danger">新密码</span></label>
                    <div class="col-sm-6">
                        <input name="newPassword" uib-tooltip="{{getMessage('newPassword',frameworkPasswordUpdateForm.newPassword.$error,validateMessages)}}"
                               tooltip-trigger="none" tooltip-is-open="frameworkPasswordUpdateForm.newPassword.$invalid && frameworkPasswordUpdateForm.newPassword.$dirty"
                               ng-model="request.newPassword" type="password" class="form-control input-sm" placeholder="新密码" validator="{repeat:repeatNewPassword}" ng-pattern="/^\w{6,20}$/" required/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="text-danger">确认新密码</span></label>
                    <div class="col-sm-6">
                        <input name="repeatPassword" uib-tooltip="{{getMessage('repeatPassword',frameworkPasswordUpdateForm.repeatPassword.$error,validateMessages)}}"
                               tooltip-trigger="none" tooltip-is-open="frameworkPasswordUpdateForm.repeatPassword.$invalid && frameworkPasswordUpdateForm.repeatPassword.$dirty"
                               ng-model="request.repeatPassword" type="password" class="form-control input-sm" placeholder="确认新密码" validator="{repeat:repeatRepeatPassword}" ng-pattern="/^\w{6,20}$/" required/>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button class="btn btn-sm btn-warning" type="button" ng-click="cancel()">取消</button>
            <button class="btn btn-sm btn-primary" type="button" ng-click="confirm()" ng-disabled="frameworkPasswordUpdateForm.$invalid || frameworkPasswordUpdateForm.$pristine">确定</button>
        </div>
    </script>
    <!-- 关于对话框 -->
    <script id="framework/about.html" type="text/ng-template" >
        <div class="modal-header">
            <h3 class="modal-title">关于</h3>
        </div>
        <div class="modal-body">
            <div class="media">
                <div class="media-left">
                    <a href="javascript:void(0)">
                        <img class="media-object" width="220" height="220" src="/client/framework/logo.jpg"/>
                    </a>
                </div>
                <div class="media-body">
                    <h1 class="media-heading"><strong class="text-info">BlackDream - 黑梦</strong></h1>
                    <form name="frameworkAboutForm" class="form-horizontal" role="form" novalidate>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">版本</label>
                            <div class="col-sm-9 form-control-static">1.0.0</div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">作者</label>
                            <div class="col-sm-9 form-control-static">LaineyC</div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">发布</label>
                            <div class="col-sm-9 form-control-static">2016-01-01</div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">邮箱</label>
                            <div class="col-sm-9 form-control-static">272874065@qq.com</div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-sm btn-primary" type="button" ng-click="confirm()">确定</button>
        </div>
    </script>
</body>
</html>